<!DOCTYPE html>
<html>
<head>
<title>Gecko caret tests</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="../../js/tinymce/tinymce.dev.js"></script>
<script>
function init() {
	tinymce.init({
		mode: "textareas",
		plugins: [
			"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
			"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
			"save table contextmenu directionality emoticons template paste"
		],
		valid_elements: '*[*]',
		add_unload_trigger : false,
		editor_selector : 'editable',
		content_css: 'css/gecko_caret.css'
	});
}

function reInit10x() {
	tinymce.execCommand('mceRemoveEditor', false, 'elm3');

	for (var i = 0; i < 10; i++) {
		tinymce.execCommand('mceRemoveEditor', false, 'elm3');
		tinymce.execCommand('mceAddEditor', false, 'elm3');
	}
}

init();
</script>
</head>
<body>

<form method="post" action="http://www.tinymce.com/dump.php?example=true">
	<div>
		<h3>Visible editor</h3>

		<div>
			<div id="container1">
				<textarea id="elm1" name="elm1" rows="7" cols="80" style="width: 80%" class="editable">
					&lt;p&gt;
						This is some text that can be edited. &lt;b contenteditable="false"&gt;This is some text that isn't &lt;em contenteditable="true"&gt;editable&lt;/em&gt;.....&lt;/b&gt;
					&lt;/p&gt;
					&lt;p&gt;
						Another paragraph.
					&lt;/p&gt;
					&lt;table&gt;
						&lt;tr&gt;&lt;td&gt;Cell&lt;/td&gt;&lt;/tr&gt;
					&lt;/table&gt;
				</textarea>
			</div>
			<a href="#" onclick="tinymce.DOM.show('container1');return false;">[Show]</a>
			<a href="#" onclick="tinymce.DOM.hide('container1');return false;">[Hide]</a>
		</div>

		<h3>Invisible editor</h3>
		<div>
			<div id="container2" style="display: none">
				<textarea id="elm2" name="elm2" rows="7" cols="80" style="width: 80%" class="editable">
					&lt;p&gt;
						This is some text that can be edited. &lt;b contenteditable="false"&gt;This is some text that isn't &lt;em contenteditable="true"&gt;editable&lt;/em&gt;.....&lt;/b&gt;
					&lt;/p&gt;
					&lt;p&gt;
						Another paragraph.
					&lt;/p&gt;
					&lt;table&gt;
						&lt;tr&gt;&lt;td&gt;Cell&lt;/td&gt;&lt;/tr&gt;
					&lt;/table&gt;
				</textarea>
			</div>

			<a href="#" onclick="tinymce.DOM.show('container2');return false;">[Show]</a>
			<a href="#" onclick="tinymce.DOM.hide('container2');return false;">[Hide]</a>
		</div>
		
		<h3>On demand editor</h3>
		<div>
			<div id="container3">
				<textarea id="elm3" name="elm3" rows="7" cols="80" style="width: 80%">
					&lt;p&gt;
						This is some text that can be edited. &lt;b contenteditable="false"&gt;This is some text that isn't &lt;em contenteditable="true"&gt;editable&lt;/em&gt;.....&lt;/b&gt;
					&lt;/p&gt;
					&lt;p&gt;
						Another paragraph.
					&lt;/p&gt;
					&lt;table&gt;
						&lt;tr&gt;&lt;td&gt;Cell&lt;/td&gt;&lt;/tr&gt;
					&lt;/table&gt;
				</textarea>
			</div>

			<a href="#" onclick="tinymce.execCommand('mceAddEditor', false, 'elm3');return false;">[Init]</a>
			<a href="#" onclick="tinymce.DOM.show('container3');return false;">[Show]</a>
			<a href="#" onclick="tinymce.DOM.hide('container3');return false;">[Hide]</a>
			<a href="#" onclick="tinymce.execCommand('mceRemoveEditor', false, 'elm3');return false;">[Remove]</a>
			<a href="#" onclick="reInit10x();return false;">[Re-init 10x]</a>
		</div>
	</div>
</form>

</body>
</html>